package com.jse.ioc;

import org.nutz.lang.util.NutMap;

public class Ioc {
	
	private Ioc() {}  
    private static Ioc single=null;  
    //静态工厂方法   
    public static Ioc create() {  
         if (single == null) {    
             single = new Ioc();  
         }    
        return single;  
    }  

	private NutMap map=new NutMap();
	
	public Object get(String name) {
		return map.get(name);
	}
	
	public <T>T get(String name,Class<T> clazz) {
		return map.getAs(name, clazz);
	}
	
	public <T> void put(String name,T t) {
		map.put(name, t);
	}
	
	public <T> void set(String name,T t) {
		map.put(name, t);
	}
}
